package com.atguigu.core.controller;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.atguigu.core.bean.R;
import com.atguigu.core.enumcode.ResultStatusCode;
import com.atguigu.core.feign.PayFeignApi;
import io.github.resilience4j.bulkhead.annotation.Bulkhead;
import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker;
import io.github.resilience4j.ratelimiter.annotation.RateLimiter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/order-micrometer")
public class OrderMicrometerController {

    @Autowired
    private PayFeignApi payFeignApi;

    @GetMapping("/micrometer/{id}")
    public R micrometer(@PathVariable("id") Integer id) {

        return R.ok().data(payFeignApi.micrometer(id) + "micrometer id:" + id + " \t " + IdUtil.simpleUUID());


    }
}
